3.4.17 \(\int \frac {\cos ^3(x)}{(a+b \sin ^2(x))^2} \, dx\) [317]

Optimal. Leaf size=59 \[ -\frac {(a-b) \tan ^{-1}\left (\frac {\sqrt {b} \sin (x)}{\sqrt {a}}\right )}{2 a^{3/2} b^{3/2}}+\frac {(a+b) \sin (x)}{2 a b \left (a+b \sin ^2(x)\right )} \]

[Out]

-1/2*(a-b)*arctan(sin(x)*b^(1/2)/a^(1/2))/a^(3/2)/b^(3/2)+1/2*(a+b)*sin(x)/a/b/(a+b*sin(x)^2)

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3269, 393, 211} \begin {gather*} \frac {(a+b) \sin (x)}{2 a b \left (a+b \sin ^2(x)\right )}-\frac {(a-b) \text {ArcTan}\left (\frac {\sqrt {b} \sin (x)}{\sqrt {a}}\right )}{2 a^{3/2} b^{3/2}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[x]^3/(a + b*Sin[x]^2)^2,x]

[Out]

-1/2*((a - b)*ArcTan[(Sqrt[b]*Sin[x])/Sqrt[a]])/(a^(3/2)*b^(3/2)) + ((a + b)*Sin[x])/(2*a*b*(a + b*Sin[x]^2))

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 393

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(-(b*c - a*d))*x*((a + b*x^n)^(p
 + 1)/(a*b*n*(p + 1))), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x]
 /; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rule 3269

Int[cos[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*(a + b*ff^2*x^2)^p, x], x, Sin[e +
f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rubi steps

\begin {align*} \int \frac {\cos ^3(x)}{\left (a+b \sin ^2(x)\right )^2} \, dx &=\text {Subst}\left (\int \frac {1-x^2}{\left (a+b x^2\right )^2} \, dx,x,\sin (x)\right )\\ &=\frac {(a+b) \sin (x)}{2 a b \left (a+b \sin ^2(x)\right )}-\frac {(a-b) \text {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\sin (x)\right )}{2 a b}\\ &=-\frac {(a-b) \tan ^{-1}\left (\frac {\sqrt {b} \sin (x)}{\sqrt {a}}\right )}{2 a^{3/2} b^{3/2}}+\frac {(a+b) \sin (x)}{2 a b \left (a+b \sin ^2(x)\right )}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.05, size = 59, normalized size = 1.00 \begin {gather*} -\frac {(a-b) \tan ^{-1}\left (\frac {\sqrt {b} \sin (x)}{\sqrt {a}}\right )}{2 a^{3/2} b^{3/2}}+\frac {(a+b) \sin (x)}{2 a b \left (a+b \sin ^2(x)\right )} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[x]^3/(a + b*Sin[x]^2)^2,x]

[Out]

-1/2*((a - b)*ArcTan[(Sqrt[b]*Sin[x])/Sqrt[a]])/(a^(3/2)*b^(3/2)) + ((a + b)*Sin[x])/(2*a*b*(a + b*Sin[x]^2))

________________________________________________________________________________________

Maple [A]
time = 0.26, size = 53, normalized size = 0.90

method result size
default \(\frac {\left (a +b \right ) \sin \left (x \right )}{2 a b \left (a +b \left (\sin ^{2}\left (x \right )\right )\right )}-\frac {\left (a -b \right ) \arctan \left (\frac {b \sin \left (x \right )}{\sqrt {a b}}\right )}{2 a b \sqrt {a b}}\) \(53\)
risch \(\frac {i \left (a +b \right ) \left ({\mathrm e}^{3 i x}-{\mathrm e}^{i x}\right )}{a b \left (b \,{\mathrm e}^{4 i x}-4 a \,{\mathrm e}^{2 i x}-2 b \,{\mathrm e}^{2 i x}+b \right )}-\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {2 i a \,{\mathrm e}^{i x}}{\sqrt {-a b}}-1\right )}{4 \sqrt {-a b}\, b}+\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {2 i a \,{\mathrm e}^{i x}}{\sqrt {-a b}}-1\right )}{4 \sqrt {-a b}\, a}+\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {2 i a \,{\mathrm e}^{i x}}{\sqrt {-a b}}-1\right )}{4 \sqrt {-a b}\, b}-\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {2 i a \,{\mathrm e}^{i x}}{\sqrt {-a b}}-1\right )}{4 \sqrt {-a b}\, a}\) \(190\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)^3/(a+b*sin(x)^2)^2,x,method=_RETURNVERBOSE)

[Out]

1/2*(a+b)*sin(x)/a/b/(a+b*sin(x)^2)-1/2*(a-b)/a/b/(a*b)^(1/2)*arctan(b*sin(x)/(a*b)^(1/2))

________________________________________________________________________________________

Maxima [A]
time = 0.48, size = 53, normalized size = 0.90 \begin {gather*} \frac {{\left (a + b\right )} \sin \left (x\right )}{2 \, {\left (a b^{2} \sin \left (x\right )^{2} + a^{2} b\right )}} - \frac {{\left (a - b\right )} \arctan \left (\frac {b \sin \left (x\right )}{\sqrt {a b}}\right )}{2 \, \sqrt {a b} a b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^3/(a+b*sin(x)^2)^2,x, algorithm="maxima")

[Out]

1/2*(a + b)*sin(x)/(a*b^2*sin(x)^2 + a^2*b) - 1/2*(a - b)*arctan(b*sin(x)/sqrt(a*b))/(sqrt(a*b)*a*b)

________________________________________________________________________________________

Fricas [A]
time = 0.41, size = 206, normalized size = 3.49 \begin {gather*} \left [\frac {{\left ({\left (a b - b^{2}\right )} \cos \left (x\right )^{2} - a^{2} + b^{2}\right )} \sqrt {-a b} \log \left (-\frac {b \cos \left (x\right )^{2} + 2 \, \sqrt {-a b} \sin \left (x\right ) + a - b}{b \cos \left (x\right )^{2} - a - b}\right ) - 2 \, {\left (a^{2} b + a b^{2}\right )} \sin \left (x\right )}{4 \, {\left (a^{2} b^{3} \cos \left (x\right )^{2} - a^{3} b^{2} - a^{2} b^{3}\right )}}, -\frac {{\left ({\left (a b - b^{2}\right )} \cos \left (x\right )^{2} - a^{2} + b^{2}\right )} \sqrt {a b} \arctan \left (\frac {\sqrt {a b} \sin \left (x\right )}{a}\right ) + {\left (a^{2} b + a b^{2}\right )} \sin \left (x\right )}{2 \, {\left (a^{2} b^{3} \cos \left (x\right )^{2} - a^{3} b^{2} - a^{2} b^{3}\right )}}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^3/(a+b*sin(x)^2)^2,x, algorithm="fricas")

[Out]

[1/4*(((a*b - b^2)*cos(x)^2 - a^2 + b^2)*sqrt(-a*b)*log(-(b*cos(x)^2 + 2*sqrt(-a*b)*sin(x) + a - b)/(b*cos(x)^
2 - a - b)) - 2*(a^2*b + a*b^2)*sin(x))/(a^2*b^3*cos(x)^2 - a^3*b^2 - a^2*b^3), -1/2*(((a*b - b^2)*cos(x)^2 -
a^2 + b^2)*sqrt(a*b)*arctan(sqrt(a*b)*sin(x)/a) + (a^2*b + a*b^2)*sin(x))/(a^2*b^3*cos(x)^2 - a^3*b^2 - a^2*b^
3)]

________________________________________________________________________________________

Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)**3/(a+b*sin(x)**2)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]
time = 0.51, size = 56, normalized size = 0.95 \begin {gather*} -\frac {{\left (a - b\right )} \arctan \left (\frac {b \sin \left (x\right )}{\sqrt {a b}}\right )}{2 \, \sqrt {a b} a b} + \frac {a \sin \left (x\right ) + b \sin \left (x\right )}{2 \, {\left (b \sin \left (x\right )^{2} + a\right )} a b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^3/(a+b*sin(x)^2)^2,x, algorithm="giac")

[Out]

-1/2*(a - b)*arctan(b*sin(x)/sqrt(a*b))/(sqrt(a*b)*a*b) + 1/2*(a*sin(x) + b*sin(x))/((b*sin(x)^2 + a)*a*b)

________________________________________________________________________________________

Mupad [B]
time = 0.14, size = 47, normalized size = 0.80 \begin {gather*} \frac {\sin \left (x\right )\,\left (a+b\right )}{2\,a\,b\,\left (b\,{\sin \left (x\right )}^2+a\right )}-\frac {\mathrm {atan}\left (\frac {\sqrt {b}\,\sin \left (x\right )}{\sqrt {a}}\right )\,\left (a-b\right )}{2\,a^{3/2}\,b^{3/2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)^3/(a + b*sin(x)^2)^2,x)

[Out]

(sin(x)*(a + b))/(2*a*b*(a + b*sin(x)^2)) - (atan((b^(1/2)*sin(x))/a^(1/2))*(a - b))/(2*a^(3/2)*b^(3/2))

________________________________________________________________________________________